<?php
if(isset($_GET['opt']))
{
	$opt = $_GET['opt'];
	$moduleID = $moduleService->getModuleIDByFuncAndOpt($context, $result, $func, $opt);
	$permit = $permitService->checkPermition($context, $result, $_SESSION['user']['type'], $moduleID);
	if($opt == 'bankList' && $permit ==true)
	{
		$start = $p->findStart($configPage['limit']);
		$count = $bankService->coundAllBank($context, $result);
		$pages = $p->findPages($count,$configPage['limit']);
		$page_list = $p->pagesList($_GET['page'],$pages,$configPage);
		$bankArr = $bankService->findAllByRange($context, $result, $start, $configPage['limit']);
		$total = "Page ".$_GET['page']." in ".$pages. " Pages";
		$smarty->assign('total', $total);
		$smarty->assign('page_list', $page_list);

		$smarty->assign('bankArr', $bankArr);
		$smarty->display($templateDir . "/temp1/bankList.tpl");
	}
	if($opt == "addBank" && $permit ==true)
	{
			
		$countryList = $countryService->findAllCountry($context, $result);
		$smarty->assign('countryList', $countryList);
		$smarty->display($templateDir . "/temp1/addBank.tpl");
	}

	if($opt == "editBank" && $permit ==true)
	{
		if(isset($_GET['id']) && is_numeric($_GET['id']))
		{
			$bank = $bankService->findAllByOid($context, $result, $_GET['id']);
			$countryList = $countryService->findAllCountry($context, $result);
			$smarty->assign('countryList', $countryList);
			$smarty->assign('bank', $bank);
			$smarty->display($templateDir . "/temp1/editBank.tpl");
		}
	}
}
?>